package dao

import (
	"common_backend/api/entity"
	. "common_backend/pkg/db"
)

func GetSysDeptList(DeptName string, DepeStatus string) (sysDept []entity.SysDept) {
	curDb := Db.Table("sys_dept")

	if DeptName != "" {
		curDb = curDb.Where("dept_name = ?", DeptName)
	}
	if DepeStatus != "" {
		curDb = curDb.Where("dept_status = ?", DepeStatus)
	}
	curDb.Find(&sysDept)
	return sysDept
}
